/**
 * Creates new Airpodder.ui.DownloaderGrid
 * @constructor
 * @param {Object} config A config object
 */
Airpodder.ui.DownloaderGrid = Ext.extend(Ext.grid.GridPanel, {
  initComponent:function() {
    var config = {
      store: new Ext.data.Store({
        proxy: new Ext.data.MemoryProxy([]),
        reader: new Ext.data.ArrayReader({}, [
          {name: 'id'},
          {name: 'episode'},
          {name: 'progress', type: 'int'},
          {name: 'size', type: 'float'},
          {name: 'speed', type: 'float'},
          {name: 'status'}
        ])
      }),
      enableColumnMove: false,
      stripeRows: true,
      autoScroll: true,
      hideHeaders: false,
      columns: [{
        header: "id",
        sortable: false,
        width: 20,
        dataIndex: 'id',
        hidden: true
      }, {
        header: "Episode",
        sortable: false,
        width: 200,
        dataIndex: 'episode',
        id: 'episode'
      }, {
        header: "Progress",
        sortable: false,
        width: 80,
        dataIndex: 'progress',
        renderer: Ext.ux.renderer.ProgressBar
      }, {
        header: "Size",
        sortable: false,
        width: 70,
        dataIndex: 'size',
        renderer: Ext.util.Format.fileSize
      }, {
        header: "Speed",
        sortable: false,
        width: 70,
        dataIndex: 'speed'
      }, {
        header: "Status",
        sortable: false,
        width: 90,
        dataIndex: 'status'
      }],
      autoExpandColumn: 'episode',
      sm: new Ext.grid.RowSelectionModel({
        singleSelect: true
      })
    };
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    Airpodder.ui.DownloaderGrid.superclass.initComponent.apply(this, arguments);
    this.store.load();
  }
  
  ,onRender:function() {
    Airpodder.ui.DownloaderGrid.superclass.onRender.apply(this, arguments);
  }
});
 
Ext.reg('downloadergrid', Airpodder.ui.DownloaderGrid); 
